package com.mdd.front.controller;

import com.mdd.common.aop.NotLogin;
import com.mdd.common.core.AjaxResult;
import com.mdd.common.core.PageResult;
import com.mdd.front.service.ICompetitionService;
import com.mdd.front.validate.common.PageValidate;
import com.mdd.front.validate.competition.CompetitionScheduleSearchValidate;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/api/competition/schedule")
public class CompetitionScheduleController {

    @Resource
    ICompetitionService iCompetitionService;

    @NotLogin
    @GetMapping("/lists")
    @ApiOperation(value="赛事列列表")
    public AjaxResult<PageResult<Map>> scheduleList(@Validated PageValidate pageValidate,
                                                            @Validated CompetitionScheduleSearchValidate searchValidate) {
        PageResult<Map> list = iCompetitionService.scheduleList(pageValidate, searchValidate);
        return AjaxResult.success(list);
    }

}
